//
//  OADLayout5.h
//  OASDK_Works
//
//  Created by ChenJie on 3/15/20.
//  Copyright © 2020 Mist. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, Direction) {
    DirectionRow,
    DirectionColumn,
};

typedef NS_ENUM(NSUInteger, JustifyContent) {
    JustifyContentFlexStart,
    JustifyContentCenter,
    JustifyContentFlexEnd,
    JustifyContentSpaceAround,
    JustifyContentSpaceBetween,
};

typedef NS_ENUM(NSUInteger, AlignItems) {
    AlignItemsFlexStart,
    AlignItemsCenter,
    AlignItemsFlexEnd,
};

@interface OADLayout5 : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, assign, readonly) BOOL isRootNode;
@property (nonatomic, assign) CGFloat containerWidth;
@property (nonatomic, assign, readonly) CGRect frame;

// flex
@property (nonatomic, assign) Direction direction;
@property (nonatomic, assign) JustifyContent justifyContent;
@property (nonatomic, assign) AlignItems alignItems;

// dimension
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;

@property (nonatomic, assign) CGFloat grow;

// margin
@property (nonatomic, assign) CGFloat marginLeft;
@property (nonatomic, assign) CGFloat marginTop;
@property (nonatomic, assign) CGFloat marginRight;
@property (nonatomic, assign) CGFloat marginBottom;

// padding
@property (nonatomic, assign) CGFloat paddingLeft;
@property (nonatomic, assign) CGFloat paddingTop;
@property (nonatomic, assign) CGFloat paddingRight;
@property (nonatomic, assign) CGFloat paddingBottom;

- (void)addNode:(OADLayout5 *)node;

- (OADLayout5 *)nodeWithName:(NSString *)name;

@end

